package utools

import (
	"strconv"
	"strings"
)

func ParamsPassingNumber(data string) ([]int, error) {
	if len(data) > 0 {
		var res []int
		numBase := strings.Split(data, "-")
		for i := 0; i < len(numBase); i++ {
			baseItem := numBase[i]
			num, err := strconv.Atoi(baseItem)
			if err != nil {
				return nil, err
			} else {
				res = append(res, num)
			}
		}
		return res, nil
	} else {
		return nil, nil
	}
}
